package com.lynk.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtils {
	private static SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
	private static SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	/**
	 * 返回当前时间(精确到日): yyyy-MM-dd
	 * @return
	 */
	public static String getTime2Da() {
		return format1.format(Calendar.getInstance().getTime());
	}
	
	/**
	 * 返回当前时间(精确到秒): yyyy-MM-dd HH:mm:ss
	 * @return
	 */
	public static String getTime2Second() {
		return format2.format(Calendar.getInstance().getTime());
	}
}
